/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Johnny
 */
@Entity
@Table(catalog = "celulares", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detalleproforma.findAll", query = "SELECT d FROM Detalleproforma d"),
    @NamedQuery(name = "Detalleproforma.findByIdDetalleProforma", query = "SELECT d FROM Detalleproforma d WHERE d.idDetalleProforma = :idDetalleProforma"),
    @NamedQuery(name = "Detalleproforma.findByCodigoArticulo", query = "SELECT d FROM Detalleproforma d WHERE d.codigoArticulo = :codigoArticulo"),
    @NamedQuery(name = "Detalleproforma.findByCantidad", query = "SELECT d FROM Detalleproforma d WHERE d.cantidad = :cantidad"),
    @NamedQuery(name = "Detalleproforma.findByPrecioVenta", query = "SELECT d FROM Detalleproforma d WHERE d.precioVenta = :precioVenta"),
    @NamedQuery(name = "Detalleproforma.findBySerie", query = "SELECT d FROM Detalleproforma d WHERE d.serie = :serie")})
public class Detalleproforma
  implements Serializable
{
  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue(strategy=GenerationType.IDENTITY)
  @Basic(optional=false)
  @Column(nullable=false)
  private Integer idDetalleProforma;

  @Basic(optional=false)
  @Column(name="codigo_articulo", nullable=false)
  private int codigoArticulo;
  private Integer cantidad;

  @Column(name="precio_venta", precision=22)
  private Double precioVenta;

  @Column(length=45)
  private String serie;

  @JoinColumn(name="numero", referencedColumnName="numero", nullable=false)
  @ManyToOne(optional=false)
  private Proforma numero;

  public Detalleproforma()
  {
  }

  public Detalleproforma(Integer idDetalleProforma)
  {
    this.idDetalleProforma = idDetalleProforma;
  }

  public Detalleproforma(Integer idDetalleProforma, int codigoArticulo) {
    this.idDetalleProforma = idDetalleProforma;
    this.codigoArticulo = codigoArticulo;
  }

  public Integer getIdDetalleProforma() {
    return this.idDetalleProforma;
  }

  public void setIdDetalleProforma(Integer idDetalleProforma) {
    this.idDetalleProforma = idDetalleProforma;
  }

  public int getCodigoArticulo() {
    return this.codigoArticulo;
  }

  public void setCodigoArticulo(int codigoArticulo) {
    this.codigoArticulo = codigoArticulo;
  }

  public Integer getCantidad() {
    return this.cantidad;
  }

  public void setCantidad(Integer cantidad) {
    this.cantidad = cantidad;
  }

  public Double getPrecioVenta() {
    return this.precioVenta;
  }

  public void setPrecioVenta(Double precioVenta) {
    this.precioVenta = precioVenta;
  }

  public String getSerie() {
    return this.serie;
  }

  public void setSerie(String serie) {
    this.serie = serie;
  }

  public Proforma getNumero() {
    return this.numero;
  }

  public void setNumero(Proforma numero) {
    this.numero = numero;
  }

  public int hashCode()
  {
    int hash = 0;
    hash += (this.idDetalleProforma != null ? this.idDetalleProforma.hashCode() : 0);
    return hash;
  }

  public boolean equals(Object object)
  {
    if (!(object instanceof Detalleproforma)) {
      return false;
    }
    Detalleproforma other = (Detalleproforma)object;
    if (((this.idDetalleProforma == null) && (other.idDetalleProforma != null)) || ((this.idDetalleProforma != null) && (!this.idDetalleProforma.equals(other.idDetalleProforma)))) {
      return false;
    }
    return true;
  }

  public String toString()
  {
    return "com.mycompany.entidades.Detalleproforma[ idDetalleProforma=" + this.idDetalleProforma + " ]";
  }
}